1. Field of the Invention
The present invention relates to a method for allocating memory using a multi-level partition, and more particularly to a memory allocation method which is capable of dividing memory into a plurality of blocks on the basis of a fixed size value used as an allocation unit, subdividing each of the divided blocks into the same number of subblocks and designating the subblocks having the same order with the same pointer value, which are included in different blocks, in order to allocate the designated subblocks as one memory space. Further, the present invention relates to a computer-readable recording medium with a program used to execute the memory allocation method.
2. Description of the Related Art
Generally, in a computer or communication equipment, in order to allocate a new memory space, first, a location is acquired at a specific memory space through an allocation procedure, and the acquired location is managed using another memory space storing an address called a pointer. In such a memory allocation, a memory space with a fixed size may be repeatedly required.
In general, a segment includes a header containing index information and payload containing divided data. Where data is divided and contained in payloads of several segments having the same sizes, in order to store the segments in memory, it is always necessary to allocate a memory space of a fixed size.
Conventionally, a start address of a memory space in memory allocation has been expressed with a pointer which has enough bit size to correctly express it. There is a problem in that the pointer has to be able to express a value which can be increased on the basis of a byte or word unit. The byte is a minimum alignment unit in memory, and the word is a unit of memory, usually 4 or 8 bytes.
Namely, conventionally, addresses for memory allocation are stored and managed on the basis of a byte or word unit using a pointer value.
U.S. Pat. No. 6,219,772 shows a technique for efficient small block memory allocation in processors. The small block memory allocation technique is capable of allocating one or more segments in memory, each of the segments being comprised of a plurality of data pages, creating the same size pool for a specified block size, assigning at least one data page to the same size pool, the data page being subdivided into a plurality of free blocks of the specified block size, accessing the data page assigned to the same size pool to satisfy a request for memory of the specified block size, and allocating one or more of the free blocks of the data page to the request, thereby being capable of effectively allocating small block memory in response to a request for the small block memory.
The small block allocation technique can allocate memory using multi-level partition. However, this conventional memory allocation technique is a method for allocating one or more small blocks in response to a memory request and can be implemented only in a software manner, so that its application range is limited. Further, the conventional memory allocation technique cannot effectively satisfy a request for memory of a size larger than a certain value.